package com.leo.component;

import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.component.Component;

public class FlagComponent extends Component {

    /**
     * 被攻击移除所有子节点
     */
    public void onHit() {
        entity.getViewComponent().clearChildren();
        entity.getViewComponent().addChild(FXGL.texture("map/flag_failed.png"));
    }
}
